#include "stdafx.h"
#include "CWindowWin32.h"

CWindow::CWindow()
{

}
CWindow::~CWindow()
{

}

void CWindow::SetCaption(const char_16 * szCaption)
{
	m_text = szCaption;
	if(m_hWnd)
	{
		SetWindowTextW(m_hWnd, m_text.GetBuffer());
	}
}
void CWindow::SetShow(bool bShow)
{
	m_bShow = bShow;
	if(m_hWnd)
	{
		ShowWindow(m_hWnd, bShow ? SW_SHOW : SW_HIDE);
	}
}

void CWindow::Create()
{
	m_hWnd = CreateWindowExW(0, L"class_xujie", m_text.GetBuffer(), WS_OVERLAPPEDWINDOW, 
		0, 0, 100, 100, NULL, NULL,
		(HINSTANCE)GetModuleHandle(NULL), 0);

	ShowWindow(m_hWnd, SW_SHOW);
	UpdateWindow(m_hWnd);

}
void CWindow::Create(int_32 iX, int_32 iY, uint_32 uiWidth, uint_32 uiHeight)
{
	m_hWnd = CreateWindowExW(0, L"class_xujie", m_text.GetBuffer(), WS_OVERLAPPEDWINDOW, 
		iX, iY, uiWidth, uiHeight, NULL, NULL,
		(HINSTANCE)GetModuleHandle(NULL), 0);
	ShowWindow(m_hWnd, SW_SHOW);
	UpdateWindow(m_hWnd);
}
